export let lxtjOption = (value, maxValue = 1000) => {
    let percent = value / maxValue;
    let option = {
        grid: {
            // left: "0%",
            // right: "10%",
            // bottom: "3%",
            containLabel: true
        },
        tooltip: {
            show: false,
            trigger: 'item',
            formatter: function (res) {
                return res.seriesName + ': ' + (res.value * 10000 / 100).toFixed(2) + '%';
            }
        },
        series: [{
            type: 'liquidFill',
            radius: '98%',
            itemStyle: {
                normal: {
                    // opacity: 0.4,
                    shadowBlur: 0,
                    shadowColor: 'blue'
                }
            },
            name: "今日完成进度",
            data: [{
                value: percent,
                itemStyle: {
                    normal: {
                        color: '#404d90',
                        opacity: 1
                    }
                }
            }],
            // background: '#fff',
            color: ['#009595'],
            center: ['50%', '50%'],
            backgroundStyle: {
                color: 'transparent'
            },
            label: {
                normal: {
                    formatter: '',
                    textStyle: {
                        fontSize: 12
                    }
                }
            },
            outline: {
                itemStyle: {
                    borderColor: '#fff',
                    borderWidth: 0
                },
                borderDistance: 0
            }
        }
        ]
    }
    return option;
}

var dataStyle = {
    normal: {
        label: {show:false},
        labelLine: {show:false}
    }
};
var optionPlaceHolderStyle2 = {
    normal: {
        color: 'transparent',
        borderColor: "rgba(255,255,255,.3)",
        borderType: "dashed",
        label: { show: false },
        labelLine: { show: false }
    },
};
export let sjztOption = (o)=>{
    let {legendData,seriesData} = o;
    const option = {
        tooltip : {
            show: false,
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient : 'vertical',
            x : 30,
            y : 90,
            icon:"roundRect",
            itemGap:12,
            textStyle:{
                color:"#afafaf",
            },
            data:legendData,
        },
        color:["#fd6226","#89c728","#f9d727","#1abbdb"],
        series : [
            {
                name:'事件状态占比分析',
                type:'pie',
                clockWise: false,
                hoverAnimation: false,
                radius : [80, 100],
                center:["75%","50%"],
                itemStyle : dataStyle,
                data:[
                    {
                        value:seriesData.value0,
                        name:seriesData.name0
                    },
                    {
                        value:100-seriesData.value0,
                        name:'invisible',
                        itemStyle : optionPlaceHolderStyle2
                    }
                ]
            },
            {
                name:'事件状态占比分析',
                type:'pie',
                clockWise:false,
                hoverAnimation: false,
                radius : [60, 80],
                center:["75%","50%"],
                itemStyle : dataStyle,
                data:[
                    {
                        value:seriesData.value1,
                        name:seriesData.name1
                    },
                    {
                        value:100-seriesData.value1,
                        name:'invisible',
                        itemStyle : optionPlaceHolderStyle2
                    }
                ]
            },
            {
                name:'事件状态占比分析',
                type:'pie',
                clockWise:false,
                hoverAnimation: false,
                radius : [40, 60],
                center:["75%","50%"],
                itemStyle : dataStyle,
                data:[
                    {
                        value:seriesData.value2,
                        name:seriesData.name2
                    },
                    {
                        value:100-seriesData.value2,
                        name:'invisible',
                        itemStyle : optionPlaceHolderStyle2
                    }
                ]
            },
            {
                name:'事件状态占比分析',
                type:'pie',
                clockWise:false,
                hoverAnimation: false,
                radius : [20, 40],
                center:["75%","50%"],
                itemStyle : dataStyle,
                data:[
                    {
                        value:seriesData.value3,
                        name:seriesData.name3
                    },
                    {
                        value:100-seriesData.value3,
                        name:'invisible',
                        itemStyle : optionPlaceHolderStyle2
                    }
                ]
            }
        ]
    }
    return option;
};

export let sjgfqyOption = ()=>{
    let option = {
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            show:false,
            data: ['事件高发区域分析']
        },
        color:["#bb0626"],
        grid: {
            left: '3%',
            right: '4%',
            bottom: "1%",
            top:20,
            containLabel: true
        },
     
        xAxis: {
          
            axisLine:{
                lineStyle:{
                    color:"#fff",
                }
            },
            axisLabel: {
                rotate: 45,
                color: "#fff"
            },
            type: 'category',
            boundaryGap: false,
            data: []
        },
        yAxis: {
            splitLine:{
                lineStyle:{
                    color:"#545454",
                    type:"dashed",
                }
            },
            axisLine:{
                lineStyle:{
                    color:"#fff",
                }
            },
            axisLabel: {
                color: "#fff"
            },
            type: 'value'
        },
        series: [
            {
                name:'事件高发区域分析',
                type:'line',
                stack: '总量',
                data:[]
            }
        ]
    };
    return option;
}
export let sjgfsdOption = ()=>{
    let option = {
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            show:false,
            data: ['事件高发时段分析']
        },
        color:["#bb0626"],
        grid: {
            left: '3%',
            right: '4%',
            bottom: "1%",
            top:20,
            containLabel: true
        },
     
        xAxis: {
          
            axisLine:{
                lineStyle:{
                    color:"#fff",
                }
            },
            axisLabel: {
                rotate: 45,
                color: "#fff"
            },
            type: 'category',
            boundaryGap: false,
            data: []
        },
        yAxis: {
            splitLine:{
                lineStyle:{
                    color:"#545454",
                    type:"dashed",
                }
            },
            axisLine:{
                lineStyle:{
                    color:"#fff",
                }
            },
            axisLabel: {
                color: "#fff"
            },
            type: 'value'
        },
        series: [
            {
                name:'事件高发区域分析',
                type:'line',
                stack: '总量',
                data:[]
            }
        ]
    };
    return option;
}

export const qsfxOption = () => {
    let option = {
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data: [],
            textStyle: {
                color: "#fff"
            },
            width:285,
            left:170,
            top:10,
            // icon:"circle",
        },
        color:["#d71c26","#327883","#e17c56","#60b391","#e74426","#ebd738"],
        grid: {
            left: '0',
            right: '1%',
            bottom: '1%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
            axisLine: {
                lineStyle: {
                    color:"#fff"
                },
            },
            axisLabel: {
                rotate: 45,
                color: "#fff"
            },
        },
        yAxis: {
            type: 'value',
            axisLine: {
                lineStyle: {
                    color:"#fff"
                },
            },
            splitLine: {
                lineStyle: {
                    color: ['#9f9f9f'],
                    type:"dashed",
                },
            },
           
            axisLabel: {
                rotate: 45,
                color: "#fff"
            },
        },
        series: []
    };
    return option;
}